﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Mvcmediaplayer.Validation;

namespace Mvcmediaplayer.Models
{
    [MetadataType(typeof(CommentMetadata))]
    public partial class Comment : IValidationModel
    {
        // Validation rules for the Comment class

        [Bind(Exclude = "Id")]
        public class CommentMetadata
        {
           [Required(ErrorMessage="VideoId is required")]
            public int VideoId {get;set;}

            [Required(ErrorMessage="User is required")]
            public object User {get;set;}

            [Required(ErrorMessage="Subject is required")]
            [StringLength(100)]
            public object Subject { get; set; }

            [Required(ErrorMessage="Content is required")]
            [StringLength(500)]
            public object Content { get; set; }

        }
    }
}